# Maintainer: Thomas Aldrian <aldrian.thom@proton.me>
pkgname=py3-freetype-py
pkgver=2.5.1
pkgrel=0
pkgdesc="FreeType Python bindings"
url="https://github.com/rougier/freetype-py"
arch="all"
license="BSD-3-Clause"
depends="freetype"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest"
source="$pkgname-$pkgver.tar.gz::https://github.com/rougier/freetype-py/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/freetype-py-$pkgver/"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4b85c8e38dfcddd180d87520c13a8e8bf366bd809cab2f5a044be33232ad7f1a1793f5a7059f9d82f659b821e9459e646c2b8c1a803ca9b8c7ffd13faf3e0b90  py3-freetype-py-2.5.1.tar.gz
"
